package com.mankiw.code_generator.service.impl;

import com.mankiw.code_generator.entity.Application;
import com.mankiw.code_generator.repository.IApplicationRepository;
import com.mankiw.code_generator.service.IApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ApplicationService implements IApplicationService {

    @Autowired
    IApplicationRepository applicationRepository;

    @Override
    public Application findById(Long id) {
        Application result = applicationRepository.findById(id).orElse(null);
        return result;
    }

    @Override
    public Application save(Application application) {
        Application result = applicationRepository.save(application);
        return result;
    }

}
